package com.erb.service.ljy;

import com.erb.entity.integral;
import com.erb.mapper.integralMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * ClassName: integralService
 * Description:积分接口
 * date: 2020/6/17 8:37
 *
 * @author JY
 */


@Service
@Transactional
public class integralService {


	@Resource
	private integralMapper integralMapper;

	public void addIntegral(integral integral) {
		integralMapper.addIntegral(integral);
	}


	/**
	 * Description: 续购买产品时需要添加积分可调用此方法
	 *
	 * @param userId:   用户ID
	 * @param integral: 添加积分数
	 * @author: JY
	 * @date: 2020/6/17 20:30
	 * @return:void
	 */
	public void addIntegralByUser(Integer userId, Integer integral) {
		integralMapper.addIntegralByUser(userId, integral);
	}


	public Integer integralQuery(Integer userId, String scoreCount, String today) {
		return integralMapper.integralQuery(userId, scoreCount, today);
	}


}
